//
//  HHAVPlayerHeader.h
//  Pods
//
//  Created by lch on 2022/1/20.
//

#ifndef HHAVPlayerHeader_h
#define HHAVPlayerHeader_h


#define iPhone4s ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(640, 960), [[UIScreen mainScreen] currentMode].size) : NO)
// 监听TableView的contentOffset
#define HHPlayerViewContentOffset          @"contentOffset"
// player的单例
#define HHPlayerShared                      [HHLuminanceView sharedLuminanceView]

// 图片
#define HHPlayerImageName(string)               [UIImage imageNamed:string inBundle:[NSBundle bundleWithPath:[[NSBundle mainBundle] pathForResource:@"HHAVPlayer" ofType:@"bundle"]] compatibleWithTraitCollection:nil]

#pragma clang diagnostic pop
CG_INLINE UIImage * _Nullable HHPlayerImage(NSString * _Nullable imageName) {
    
    NSString *imageBundlePath = [[NSBundle mainBundle] pathForResource:@"HHAVPlayer" ofType:@"bundle"];
    NSBundle *imageBundle = [NSBundle bundleWithPath:imageBundlePath];
    UIImage *image = [UIImage imageNamed:imageName inBundle:imageBundle compatibleWithTraitCollection:nil];
    
    return image;
}

// 返回按钮的block
typedef void(^HHPlayerGoBackBlock)(void);
// playerLayer的填充模式（默认：等比例填充，直到一个维度到达区域边界）
typedef NS_ENUM(NSInteger, HHPlayerLayerGravity) {
     HHPlayerLayerGravityResize,           // 非均匀模式。两个维度完全填充至整个视图区域
     HHPlayerLayerGravityResizeAspect,     // 等比例填充，直到一个维度到达区域边界
     HHPlayerLayerGravityResizeAspectFill  // 等比例填充，直到填充满整个视图区域，其中一个维度的部分区域会被裁剪
};

// 枚举值，包含水平移动方向和垂直移动方向
typedef NS_ENUM(NSInteger, PanDirection){
    PanDirectionHorizontalMoved, //横向移动
    PanDirectionVerticalMoved    //纵向移动
};

//播放器的几种状态
typedef NS_ENUM(NSInteger, HHPlayerState) {
    HHPlayerStateFailed,     // 播放失败
    HHPlayerStateBuffering,  //缓冲中
    HHPlayerStatePlaying,    //播放中
    HHPlayerStateStopped,    //停止播放
    HHPlayerStatePause       //暂停播放
};


#import "HHLuminanceView.h"
#import "HHPlayerControlView.h"
#import "HHPlayerView.h"
#import "HHLuminanceView.h"
#import "HHDownloadManager.h"
#import "HHPlayerViewController.h"
#import "HHPlayerNoControlView.h"

#endif /* HHAVPlayerHeader_h */
